<!DOCTYPE html>
<html>
    <head>
        <title></title>
    </head>
<body>
    <h1>精神科</h1>
<script>
	var ws = new WebSocket('ws://127.0.0.1:1234');
	ws.onopen = function(){
		var uid = 'user2';
		ws.send(uid);
	};
	ws.onmessage = function(e){
		//alert(e.data);
		console.log(e.data);
		console.log(JSON.parse(e.data))
		
		let msg = JSON.parse(e.data)
		alert("紧急通知\n\n科室：" + msg.dep + "\n\n地点：" + msg.address)
		//window.location.reload();
	};
</script>
</body>
</html>